import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 导入全局初始化样式
import './assets/css/index.css'
import './assets/css/iconfont.css'
import './plugins/element.js'

Vue.config.productionTip = false

// 过滤器  全局只能使用一个
Vue.filter('changeTime', value => {
  let min = parseInt(value / 1000 / 60)
  if (min < 10) min = '0' + min
  let sec = parseInt((value / 1000) % 60)
  if (sec < 10) sec = '0' + sec
  const time = `${min}分${sec}秒`
  return time
})
Vue.filter('changeCount', value => {
  if (value > 100000) {
    const playCount = parseInt(value / 100000) + '万'
    return playCount
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
